home *** CD-ROM | disk | FTP | other *** search
- ' QSEND and QRECV are used in conjunction to transmit files from one
- ' computer to another when they have incompatible diskette drives and there's
- ' no other way for them to communicate. All that is nessecary is to have
- ' QRECV running on the receiving end, QSEND running on the sending end, and
- ' a cable connecting the COM1 port on both machines. The cable can be very
- ' simple, composed of as few as four wires; ground, transmitted data,
- ' received data, and data terminal ready. The cable should be wired pin 2
- ' to pin 3, pin 3 to pin 2, pin 7 to pin 7 and pin 20 to pin 20.
- '
- ' If you have no simple way to download these files to both systems,
- ' then the short interpreted basic programs SEND and RECV can be type on the
- ' other end and used to transfer these files to that end. If they fail to
- ' work, try using a larger communications buffer (use BASICA/C:XXXX), and
- ' adding wait loops to SEND to slow it down.
- '
- ' Both SEND and QSEND have the ability to accept a file name that is a
- ' list of the files you want to move. The file must use 'SND' as it's
- ' extension, and the file names must be entered one to a line in the first
- ' twelve characters of the line. The file can be created by redirecting
- ' the DIR command to a file (I.E.> DIR > FILE.SND), and then edited to
- ' remove all the lines that aren't file names, or that you don't want
- ' to move.
- '
- ' QSEND and QRECV use a very simple check byte after each block. It
- ' has been useful for us, but it isn't very comprehensive. It should
- ' offer a good place to start experimenting, and it really is a great
- ' help when your trying to get files onto a PS/2 without a network.
- ' When you compile them, be sure to set the communications buffer at 1K
- ' or higher (\C:1024).
- '
- ' Donald Cross
- ' Systems Programmer
- ' Fairmont Railway Motors
- ' Fairmont MN, 56031
-
-
- DEFINT A-Z
- TV$=CHR$(255)
- OPEN "com1:9600,n,8,1,rs,cs,ds,cd" AS #1
-
- 40
- IF LF THEN _
- 210 _
- ELSE _
- CLS _
- :LOCATE 3,20 _
- :PRINT "QSEND - Asynchronous file transfer utility" _
- :locate 5,10 _
- :INPUT"File to send";F$ _
- :IF F$="" THEN _
- CLOSE _
- :END
- T=INSTR(1,F$,".")
- IF T>0 THEN _
- T$=MID$(F$,T+1,3) _
- :IF T$="SND" OR T$="snd" THEN _
- LF=1 _
- :GOTO 200
-
- 50
- OPEN F$ FOR INPUT AS #2
- CLOSE 2
- OPEN F$ AS #2 LEN=512
- FIELD#2, 512 AS B$
- L!=LOF(2)
- SEND.LEN=LEN(F$)+4
- MID$(B$,1,SEND.LEN)=MKS$(L!)+F$
- GOSUB SEND.RTN
- T!=0
- BC=0
- LOCATE 7,5
- PRINT "Sending ";F$;L!;"bytes,";INT(L!/512)+1;"blocks "
- SEND.LEN=512
- WHILE T!<L!
- GET#2
- T!=T!+512
- IF T!>L! THEN _
- SEND.LEN=512-(T!-L!)
- GOSUB SEND.RTN
- WEND
- CLOSE 2
- GOTO 40
-
- 200
- OPEN F$ FOR INPUT AS #3
-
- 210
- IF EOF(3) THEN _
- LF=0 _
- :CLOSE 3 _
- :GOTO 40
- INPUT#3, F$
- F$=LEFT$(F$,8)+"."+MID$(F$,10,3)
- GOTO 50
-
- SEND.RTN:
- BC=BC+1
- LOCATE 10,10
- PRINT "Block"; BC
- RC=0
- CB=0
- FOR J=1 TO SEND.LEN
- CB=CB+ASC(MID$(B$,J,1))
- CB=CB-INT(CB/256)*256
- NEXT
- WHILE LOC(1)>0
- T$=INPUT$(1,#1)
- WEND
- SEND.RETRY:
- PRINT #1, TV$;LEFT$(MKI$(CB),1);MKI$(SEND.LEN);
- PRINT #1, LEFT$(B$,SEND.LEN);
- WHILE LOC(1)=0
- WEND
- T$=INPUT$(1,#1)
- IF T$<>TV$ THEN _
- RC=RC + 1 _
- :LOCATE 10,30 _
- :PRINT RC;"retries" _
- :GOTO SEND.RETRY
- LOCATE 10,30
- PRINT SPACE$(30)
- RETURN
-